home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Text⁄Files / think c pap ƒ / think-c-pap-routines-doc.txt^M < prev    next >
Encoding:
Text File  |  1989-02-05  |  2.3 KB  |  53 lines  |  [TEXT/MACA]

  1. cat think-c-pap-routines-doc.txt
  2. From: sw@kernel-technology.co.uk (Sak Wathanasin)
  3. Subject: ThinkC Source for PAP i/f routines 
  4. Date: 29 Jan 89 15:13:33 GMT 
  5. Organization: Kernel Technology Ltd 
  6.  
  7. I've just received my Jan 89 copy of MacTutor, and I noticed the request
  8. for PAP i/f routines.  I attach below two files: pap.c and pap.h that are
  9. meant to be built into a project, and called from your host application.
  10. Because I do not build them into a DRVR (although you can), they are much
  11. simpler.  Morever, they are self-contained and can be built using the
  12. ThinkC compiler alone (I've used both ThinkC 2.x and 3.0).
  13.  
  14. The pap.c file includes a set of test routines (conditonally compiled
  15. using the variable TEST).  When enabled, they simulate the action of the
  16. LW, but write the PS to a file. This allows you to test the sequence of
  17. PAP calls without having an LW present. To use the test routines, just
  18. call the PAP routines as usual, and periodically call the routine
  19. TestDelay (your main event loop is a good place).
  20.  
  21. To use them,
  22.   a) call the routine PAPLoad once to load the PAP routines from the
  23.      LW driver
  24.   b) call PAPOpen to open a connection to the LW
  25.   c) call PAPRead/PAPWrite as required to talk to the printer
  26.   d) call PAPClose to close the connection to the printer
  27.   e) repeat (b) to (d) as required; see MacTutor article on details of
  28.      how to send EOF to the printer
  29.   f) the PAPStatus call can be used to return info about the printer at
  30.      any time
  31.   f) call PAPUnload once before your application exits (you must do this
  32.      because the PAP mgr has VBL tasks running and these must be removed)
  33.  
  34. I hope that you will find these routines useful. I have used them with
  35. all vintages of LW drivers from 2.0 to 5.2, and all Systems from 2.1 to
  36. 6.0.2 (note that if you use a machine with the 64K roms, you may have to
  37. install the AppleTalk drivers in your system file).
  38. I would be glad to hear of any bug reports.
  39.  
  40. If anyone can add any details of the PAP mgr to that contained in Bob
  41. Denny's excellent MacTutor article, please post to the net. In particular,
  42. I'd like to know if there is any way of aborting a PS job once it has
  43. started.
  44.  
  45. Sak Wathanasin
  46.  
  47. uucp:...!ukc!kernel!sw
  48. JANET:  sw@uk.co.kernel
  49. BITNET: sw%kernel.co.uk%ukc.ac.uk@ukacrl.bitnet
  50. other:sw@kernel.co.uk
  51. phone:(+44) 532 444566
  52. snail:Kernel Technology Ltd, 46 The Calls, Leeds LS2 7EY
  53. command: